﻿namespace CxRomos.Core.Domain.Entities {
    public class Person {
        public Person() {}

        public virtual int PersonId { get; set; }
        public virtual string Email { get; set; }
        public virtual string FirstName { get; set; }
        public virtual string LastName { get; set; }

        public override int GetHashCode() {
            int toReturn = base.GetHashCode();
            toReturn ^= PersonId.GetHashCode();
            return toReturn;
        }

        public override bool Equals(object obj) {
            if (obj == null) {
                return false;
            }
            var toCompareWith = obj as Person;
            return toCompareWith == null ? false : ((PersonId == toCompareWith.PersonId));
        }
    }
}